package main.java.com.study.java8;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by .
 */
public class lambda {
    public static void main(String[] args) {

        List<String> list = new ArrayList<>();
        for(int i=0;i<10000;i++){
            list.add(String.valueOf(i));
        }

        //lambda表达式
        long start = System.currentTimeMillis();
//        list.parallelStream().forEach((s)->{
//            s.toString();
//        });
        list.forEach(s->{
            s.toString();
        });
        //普通测试
//        for (Object s :list){
//            s.toString();
//        }

        //普通测试
        for (int i = 0; i < list.size(); i++) {

        }
        
        long end = System.currentTimeMillis();
        System.out.println("耗时："+(end-start) +"  ms");
    }
}
